﻿
#region 版权声明





//



// 
// 代码开源主要用于解决大家在学习和研究协议过程中遇到由于缺乏代码所带来的制约性问题。
// 本代码仅供学习交流使用，大家在使用此开发包前请自行协调好多方面关系，
// 不得用于任何商业用途和非法用途，本人不享受和承担由此产生的任何权利以及任何法律责任。
// 
// 本源代码可通过以下网址获取:
// http://www.vckers.com
//
// Copyright @ 2009-2010  vckers.com.  All Rights Reserved.   
// Framework: 3.5

  

 
//   
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. 
  
#endregion

using System;
using System.Collections.Generic;
using System.Text;

namespace TS.QQ.Entities
{
    /// <summary>天气情况数据
    /// </summary>
    public class Weather
    {
        /// <summary>服务器返回的整型表示的日期
    /// </summary>
        /// <value></value>
        public int Time { get; set; }
        /// <summary>年
    /// </summary>
        /// <value></value>
        public int Year { get; set; }
        /// <summary>月
    /// </summary>
        /// <value></value>
        public int Month { get; set; }
        /// <summary>日期
    /// </summary>
        /// <value></value>
        public int Day { get; set; }
        /// <summary>描述
    /// </summary>
        /// <value></value>
        public string ShortDesc { get; set; }
        /// <summary>风
    /// </summary>
        /// <value></value>
        public string Wind { get; set; }
        /// <summary>最低温度
    /// </summary>
        /// <value></value>
        public int LowTemperature { get; set; }
        /// <summary>最高温度
    /// </summary>
        /// <value></value>
        public int HighTemperature { get; set; }
        public string Hint { get; set; }
        public void Read(ByteBuffer buf)
        {
            Time = buf.GetInt();
            int len = buf.Get() & 0xFF;
            ShortDesc = Utils.Util.GetString(buf, len);
            len = buf.Get() & 0xFF;
            Wind = Utils.Util.GetString(buf, len);
            LowTemperature = buf.GetUShort();
            HighTemperature = buf.GetUShort();
            buf.Get();
            len = buf.Get() & 0xFF;
            Hint = Utils.Util.GetString(buf, len);

            DateTime date = Utils.Util.GetDateTimeFromMillis((long)Time * 1000L);
            Year = date.Year;
            Month = date.Month;
            Day = date.Day;
        }
    }
}
